package com.harmontronics.hanma.paas.paas.domain.releasesetup.repository.persistence;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.harmontronics.hanma.paas.paas.consts.DbConstants;
import com.harmontronics.hanma.paas.paas.domain.releasesetup.entity.valueobject.Fields;
import com.harmontronics.hanma.paas.paas.domain.releasesetup.repository.mapper.HmModelUpdateSqlMapper;
import com.harmontronics.hanma.paas.paas.domain.releasesetup.repository.po.HmModelUpdateSqlPO;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository("hmModelUpdateSqlRepository")
public class HmModelUpdateSqlRepository extends ServiceImpl<HmModelUpdateSqlMapper, HmModelUpdateSqlPO> {
    public List<HmModelUpdateSqlPO> getByAppUniqueAndSequence(String appUnique, Long sequence) {
        QueryWrapper<HmModelUpdateSqlPO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(Fields.APP_UNIQUE, appUnique);
        queryWrapper.eq(Fields.RELEASE_SEQUENCE, sequence);
        queryWrapper.orderByAsc(DbConstants.CREATE_DATE);
        return baseMapper.selectList(queryWrapper);
    }
}